<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of soaUsers
 *
 * @author dxx
 */

namespace app\common\model\jooj_config;

use think\Model;

class SoaUsers extends Model {

    protected $table = 'soa_users';
    protected $connection = ['database' => 'jooj_config'];

//自定义初始化
    protected function initialize() {
        parent::initialize();
    }

    public function getUserInfo($appId, $appSecret) {
//        try {
            return $this->where(['app_secret' => $appId, 'app_secret' => $appSecret, 'api_user_status' => 1])->cache(true, 3600)->find();
//        } catch (\Exception $e) {
//            throw new \Exception($e->getMessage());
//        }
    }

}
